<template>
    <header>
        <!-- <div id="header_logo"></div>
        <div style="flex : 1"></div> -->
        <div id="Title">对抗样本测试平台</div>
        <div id="header_person">
            <el-button size="small"  icon="el-icon-refresh" @click="GoToIndex">首页</el-button>
            <el-button size="small"  type="primary" icon="el-icon-s-home"   @click="GoToMainpage">主页</el-button>
          <logOut></logOut>
        </div>
    </header>
</template>

<style scoped>
header {
    border-bottom: 2px solid #d3d3d3;
    /* border: 10px solid #d3d3d3; */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 10vh;
    background-color: #222F48;
    display: flex;
    justify-content: space-between; /* 使两侧元素分别靠边 */
    padding-right: 20px;
    align-items: center;
    z-index: 1000; /* 确保header位于其他内容之上 */
}

#header_logo {
    /* width: 120px; */
    text-align: center;
    margin-top: 20px;
}

#header_person {
    width: 300px; /* 根据需要调整宽度 */
    display: flex; /* 使用Flexbox布局 */
    justify-content: flex-end; /* 将子元素排列到容器的末端 */
    align-items: center; /* 垂直居中对齐 */
    padding-right: 2vh;

}

.example-showcase .el-dropdown-link {
    cursor: pointer;
    color: var(--el-color-primary);
    display: flex;
    align-items: center;
}

.flex-grow {
    flex-grow: 1;
}
#Title{


    left: 55px;
    top: 0px;
    width: 602px;
    height: 40px;
    opacity: 1;
    padding-left: 2vh;

    /** 标题格式 */
    font-family: PangMenZhengDao;
    font-size: 25px;
    font-weight: 400;
    letter-spacing: 0px;
    line-height: 40px;
    color: rgba(255, 255, 255, 1);
    border-color: rgba(23, 98, 241, 0.91);
    text-align: left;
    vertical-align: top;
    /** 标题格式 */
}
</style>
<script>
import logOut from './logOut.vue'
export default {
    name: "HEADER",
  components:{
    logOut
  },
    data(){
        return{
            activeIndex:'1',
        }
    },
    methods:{
        GoToIndex(){
            // console.log('触发了GotoIndex')
            // console.log(this.$router.currentRoute)
            if(this.$router.currentRoute.path !== '/'){
                this.$router.push({path:"/"})
            }
        },
        GoToMainpage(){
            if(this.$router.currentRoute.path !== '/Mainpage/AdvIntro'){
                this.$router.push({path:"/Mainpage/AdvIntro"})
            }
        }
    }
}
</script>

